package com.pkche.core.base.converter;

import org.springframework.core.convert.converter.Converter;

/**
 * @FileName      : BooleanConverter.java
 * @Author        : pq
 * @Create Date   : 2012-10-19
 * @Last Modified :   
 * @Description   : 布尔型转换
 */
public class BooleanConverter implements Converter<String , Boolean> {

	public Boolean convert(String source) {
		if ("true".equals(source) || "1".equals(source)) {
			return Boolean.valueOf(true);
		}
		if ("false".equals(source) || "0".equals(source)) {
			return Boolean.valueOf(false);
		}
		return false;
	}
 
}
